#!/bin/bash

#
# find files that do not constitute valid XML
# and create a bash script that will delete them.
#
# This script doesn't actually delete the files.
#
# Note: make sure no file starts with a - or -- before
# running this script - clean those manually.
#

for file in *.dataxml
do
	if ! xmllint --noout $file > /dev/null 2>&1
	then
		printf "/bin/rm -- '%s'\n" $file 
	fi
done
